package com.example.baseweather;

import android.app.Application;
import android.os.Handler;

public class MyApplication extends Application {

    private static MyApplication instance;
    private static Handler mHandler;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = MyApplication.this;
        mHandler = new Handler(getMainLooper());
    }

    public static MyApplication getInstance() {
        return instance;
    }


    public static void postMessage(Runnable workTask) {
        MyApplication.mHandler.post(workTask);
    }


    public static Handler getHandler() {
        return mHandler;
    }
}
